package com.example.service.impl;

import com.example.domain.pojo.Order;
import org.springframework.web.reactive.function.client.WebClient;

import java.util.stream.IntStream;

/**
 * @author ljs
 * @date 2025/7/16
 */
public class test {
    public static void main(String[] args) {
        WebClient client = WebClient.create("http://localhost:9001");

        IntStream.range(0, 100).parallel().forEach(i -> {
            client.post()
                    .uri("/order/create")
                    .bodyValue(new Order(i, "product_"+i,10.5F,100))
                    .retrieve()
                    .bodyToMono(String.class)
                    .subscribe();
        });

    }
}
